/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package conexion;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author andrade
 */
@Entity
@Table(name = "logueo", catalog = "save", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Logueo.findAll", query = "SELECT l FROM Logueo l"),
    @NamedQuery(name = "Logueo.findByIdentificacion", query = "SELECT l FROM Logueo l WHERE l.identificacion = :identificacion"),
    @NamedQuery(name = "Logueo.findByContrasena", query = "SELECT l FROM Logueo l WHERE l.contrasena = :contrasena"),
    @NamedQuery(name = "Logueo.findByTipoUsuario", query = "SELECT l FROM Logueo l WHERE l.tipoUsuario = :tipoUsuario")})
public class Logueo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "Identificacion", nullable = false)
    private Integer identificacion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "contrasena", nullable = false, length = 10)
    private String contrasena;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TipoUsuario", nullable = false)
    private int tipoUsuario;

    public Logueo() {
    }

    public Logueo(Integer identificacion) {
        this.identificacion = identificacion;
    }

    public Logueo(Integer identificacion, String contrasena, int tipoUsuario) {
        this.identificacion = identificacion;
        this.contrasena = contrasena;
        this.tipoUsuario = tipoUsuario;
    }

    public Integer getIdentificacion() {
        return identificacion;
    }

    public void setIdentificacion(Integer identificacion) {
        this.identificacion = identificacion;
    }

    public String getContrasena() {
        return contrasena;
    }

    public void setContrasena(String contrasena) {
        this.contrasena = contrasena;
    }

    public int getTipoUsuario() {
        return tipoUsuario;
    }

    public void setTipoUsuario(int tipoUsuario) {
        this.tipoUsuario = tipoUsuario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (identificacion != null ? identificacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Logueo)) {
            return false;
        }
        Logueo other = (Logueo) object;
        if ((this.identificacion == null && other.identificacion != null) || (this.identificacion != null && !this.identificacion.equals(other.identificacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "conexion.Logueo[ identificacion=" + identificacion + " ]";
    }
    
}
